﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;
using IBll.Sys;
using Model.Sys.Config;

namespace Bll.Sys
{
    public class SiteConfigBll : ISiteConfigBll
    {
        private static readonly object LockHelper = new object();

        public void SaveConfig(SiteConfig config, string configPath)
        {
            lock (LockHelper)
            {
                SerializeHelper.XmlSerialize(config, configPath);
            }
        }

        public SiteConfig LoadConfig(string configPath)
        {
            return (SiteConfig)SerializeHelper.XmlDeSerialize(typeof(SiteConfig), configPath);
        }
    }
}
